import { getRoleList } from '../../../request/api'
interface roleState {
    roleList: Array<object>
}
const state = {
    roleList: []
}
const getters = {
    getRole(state: roleState) {
        return state.roleList
    }
}
const mutations = {
    REQ_ROLE(state: roleState, payload: any) {
        state.roleList = payload
    }
}
const actions = {
    changeRoleAction({ commit }: any) {
        getRoleList().then((res: any) => {
            commit('REQ_ROLE', res.data.list)
        })
    }
}
export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}